﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using DotNetCore.CAP;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;

namespace CapDemo.Controllers
{
    public class CapController : Controller
    {
        private readonly ILogger<CapController> _logger;

        public CapController(ILogger<CapController> logger)
        {
            _logger = logger;
        }

        [CapSubscribe("capdemo.test.msg", Group = "yww_test")]
        public void CheckReceivedMessage(string str)
        {
            _logger.LogInformation($"消息接收成功:{str}");
        }
    }
}
